from tortoise.models import Model
from tortoise import fields


class MedicineDetail(Model):
    """
    详细信息
    """
    s_id = fields.CharField(max_length=255, description='表主键s_id', pk=True)
    g_id = fields.CharField(max_length=255, description='g_id')
    specification = fields.TextField(description='规格')
    model = fields.TextField(description='型号')
    unit = fields.CharField(max_length=255, description='计量单位')
    material_quality = fields.CharField(max_length=255, description='材质')
    class_name = fields.TextField(description='分类名称')
    pack_unit = fields.CharField(max_length=255, description='包装单位')
    is_sterilization = fields.CharField(max_length=255, description='是否灭菌')


class MedicineInfo(Model):
    """
    基本信息
    """
    id = fields.CharField(max_length=200, description='表主键', pk=True)
    procure_id = fields.CharField(max_length=255, description='商品代码')
    produce_name = fields.TextField(description='单件商品名称')
    reg_code = fields.TextField(description='注册备案编号')
    reg_produce_name = fields.TextField(description='注册备案产品名称')
    specification = fields.TextField(description='规格')
    model = fields.TextField(description='型号')
    produce_company_name = fields.CharField(max_length=255, description='生产企业')
    sc_declare_company_name = fields.CharField(max_length=255, description='四川申报企业')
    country_declare_company_name = fields.CharField(max_length=255, description='国家申报企业')
    purchase_class = fields.CharField(max_length=255, description='分类采购类别')
    relation_old_produce_code = fields.CharField(max_length=255, description='关联老产品流水号', default='')
    last_month_average_price = fields.CharField(max_length=255, description='截止上月末全省医疗机构采购加权平均价')
    high_price = fields.CharField(max_length=255, description='我省最高参考价')
    linkage_reference_price = fields.CharField(max_length=255, description='联动参考价')
    year = fields.CharField(max_length=255, description='年')
    month = fields.CharField(max_length=255, description='月')
